package com.quanyan.pay.enums;

/**
 * Created by Zheng.Ke
 * Date 2017/3/29.
 */
public enum AliTradeTypeEnum {
    TRADE("TRADE", "交易"),
    REFUND("REFUND", "退款")
    ;

    AliTradeTypeEnum (String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private String code;
    private String desc;

    public static AliTradeTypeEnum getAliTradeTypeEnumByDesc(String desc) {
        for (AliTradeTypeEnum aliTradeTypeEnum : AliTradeTypeEnum.values()) {
            if (aliTradeTypeEnum.getDesc().equals(desc)) {
                return aliTradeTypeEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
